package com.traffic.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.traffic.entity.Auth;
import com.traffic.entity.QueryResult;
import com.traffic.entity.Role;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: KingRainGrey
 * Date: 2020/9/27
 */
public interface AuthService extends IService<Auth> {
    List<Auth> getAuthList();

    Boolean giveAuth(Long authId, Long roleId);

    Boolean removeAuth(Long authId, Long roleId);

    Role addRole(String name);

    Role editRole(String name, Long roleId);

    Role findRole(String name);

    List<Role> queryRoles(Integer currentPage, Integer pageSize);

    QueryResult queryRolesPages(Integer currentPage, Integer pageSize);

    Boolean setRoleAdmin(Long adminId, Long roleId);

    Boolean setRoleUser(Long userId, Long roleId);

    Integer deleteRole(List<Long> ids);

    Boolean deleteRole(Long id);

    List<Role> getAllRole();

    List<Auth> getAllAuth();

    Boolean createRole(String name, List<Integer> auths);

    Boolean editRole(Integer id, String name, List<Integer> auths);

    Role queryRoleById(Integer id);
}
